#! /bin/sh
WIDTH=350
XOFF1=380
XOFF2=760
XOFF2=860
HEIGHT=450
YOFF1=520

# First make the synthetic data for the demo.
echo
echo
echo
echo "Making synthetic data for demo"
######START OF MODEL######
REF1="1.0:-1,0.2;4,0.2"
REF2="1.0:-2,2.0199;3.5495,0"
REF3="1.0:-2,4.3955;3.2384,0"
REF4="1.0:-2,8.8603;3.1155,0"

dvdz=.015  # velocity gradient (dv/dz)
dvdx=-0.2  # velocity gradient (dv/dx)
v00=5.0  # velocity at surface in km/s
nxo=6    # number of offsets
fxo=0.04 dxo=0.04 
nxs=12 fxs=1.0 dxs=0.04  # to make shot gathers

nt=200 dt=0.004 

susynlv v00=$v00 ndpfz=10 dvdz=$dvdz \
		dt=$dt nt=$nt verbose=0 \
		ref=$REF1 ref=$REF2 ref=$REF3 ref=$REF4 \
		nxo=$nxo fxo=$fxo dxo=$dxo \
		nxs=$nxs fxs=$fxs dxs=$dxs  |
suchw key1=cdp key2=gx key3=sx b=1 c=1 d=2 > modeldata
######END OF MODEL######

# Plot the model 
suximage <modeldata perc=99 title="Shot Gathers"  n3=1 \
	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.166667   \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=0 ybox=0 &
 
 
######SELECTING EXAMPLES: GROUP ONE######
# Get a stacking chart
suchart <modeldata |                     
xgraph n=72 title="Stacking Chart" label1="sx" label2="gx" \
	linecolor=2 linewidth=0 marksize=2 mark=8 \
	-geometry ${WIDTH}x${HEIGHT}+${XOFF3}+0 &

# Select even numbered shot gathers (s=0 is the default in suwind)
# NOTES: The fldr field is usually numbered sequentially as the
#	nominal number of the shot gather.  The sx field usually gives
#	the shot location.  One could select on sx by examining its values
#	with sugethw, e.g.,
#		sugethw <modeldata sx | more
#	to find that the first sx=1000 and that the moveup is 40 between shots.
#	Thus a selecting command equivalent to the
#		suwind <modeldata key=fldr j=2 | ...
#	given below would be
#		suwind <modeldata key=sx s=1040 j=80 | ...
#	But when fldr is set, it is easier to use and we stick to this below.
suwind <modeldata key=fldr j=2 |
suximage perc=99 title="Even Shots" n3=1 \
	label1="Time (sec)" label2="Shot Gather" f2=2 d2=0.33333 \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF1} ybox=0 &

# Select odd numbered shot gathers
suwind <modeldata key=fldr j=2 s=1 |
suximage perc=99 title="Odd Shots" n3=1 \
	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.33333 \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=0 ybox=${YOFF1} &

# Select every other even shot gather between 4th and 8th gather
suwind <modeldata key=fldr j=2 min=4 max=8 |
suximage perc=99 title="4th-8th Even Shots" n3=1 \
	label1="Time (sec)" label2="Shot Gather" f2=4 d2=0.33333 \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${XOFF1} ybox=${YOFF1} &

exit
